package Behaviours;

import Agents.MessengerAgent;
import jade.core.behaviours.CyclicBehaviour;
import jade.lang.acl.ACLMessage;

public class MessageReceiver extends CyclicBehaviour{
	private MessengerAgent target;
	
	public MessageReceiver(MessengerAgent agent){
		target=agent;
	}
	
	public void action() {
		ACLMessage msg = target.receive();
		if(msg!=null){
			target.processMessage(msg);
		}
		
	}

}
